Skip to content

Instantly share code, notes, and snippets.

@hhuynhlam
hhuynhlam / devtools.html
Created September 17, 2016 19:52
com.haihuynhlam.knockoutjs-inspector
<html>
<body>
<a href="http://src/pages/devtools.js">
http://src/pages/devtools.js
</a>
</body>
</html>
@TaijaQ
TaijaQ / A DevTools Extension
Last active May 17, 2024 01:29
Guide to Extending DevTools
A DevTools extension adds functionality to the Chrome DevTools. It can add new UI panels and sidebars, interact with the inspected page, get information about network requests, and more.
#EXTM3U url-tvg="https://iptvx.one/EPG"
#EXTINF:-1, O-la-la
http://31.148.48.15:80/O-la-la/index.m3u8?token=test
#EXTINF:-1, Erox
http://94.229.250.73:8008/play/a002
#EXTINF:-1, Playboy
http://190.11.225.124:5000/live/playboy_hd/playlist.m3u8
#EXTINF:-1 tvg-logo="http://wow-model.com/wp-content/uploads/2017/09/visit-x-tv.jpg", Visit-X
http://stream.visit-x.tv:1935/vxtv/live_720p/playlist.m3u8
#EXTINF:-1, Шелк
@shunchu
shunchu / convert-seconds-into-hh-mm-ss-in-ruby.rb
Created July 25, 2012 07:58
Convert seconds into HH:MM:SS in Ruby
t = 236 # seconds
Time.at(t).utc.strftime("%H:%M:%S")
=> "00:03:56"
# Reference
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time
@arrlancore
arrlancore / use-persisted-form.ts
Created May 17, 2024 01:09
A custom React Hook Form that persists form data to localStorage. It takes an object containing the form ID, default values, and schema as input and returns a tuple containing the form methods and a clearFormData function. The clearFormData function is used to clear the form data from localStorage. The form data is saved to localStorage whenever…
import { useEffect } from 'react';
import { DefaultValues, FieldValues, Resolver, useForm, UseFormReturn } from 'react-hook-form';
interface UsePersistedFormOptions<TFormValues extends FieldValues> {
formId: string;
defaultValues?: DefaultValues<TFormValues>;
schema?: Resolver<TFormValues>;
}
/**
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@MrMightyNighty
MrMightyNighty / minimal-compose-wekan.yaml
Last active May 17, 2024 01:07
A minimal wekan docker-compose file to start Wekan without a mail server. You will get a "Internal Server Error" if you create your first user but don't worry the user will still be added to the database and you can login without any issues.
version: '2'
services:
wekandb:
#-------------------------------------------------------------------------------------
# ==== MONGODB FROM DOCKER HUB ====
image: mongo:6
#-------------------------------------------------------------------------------------
container_name: wekan-db
restart: always
# command: mongod --oplogSize 128
@jboner
jboner / latency.txt
Last active May 17, 2024 01:05
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active May 17, 2024 01:02
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

#!/bin/sh
# https://github.com/greymechanic/loopVideo
# clear terminal text, set background to black, and hide the cursor
setterm -cursor off
setterm -term linux -background black
setterm -term linux clear
# this is the path to the directory containing your videos
VIDEOPATH="/home/pi/Videos"